package com.yuju.common;

import java.io.Serializable;

/**
 * 类名：Page  <br />
 *
 * 功能：分页查询工具
 *
 * @author : xuehj <br />
 * @Date : 2017年9月13日 下午2:19:38  <br />
 * @version : 1.1 <br />
 */
public class Page implements Serializable {
	private static final long serialVersionUID = 1L;
	
	// 分页查询开始记录位置
	private int begin;
	
	// 分页查询结束位置
	private int end;
	
	// 每页记录数
	private int length;
	
	// 当前页码
	private int current;
	
	public Page() {
		super();
	}
	
	public Page(int length, int current) {
		super();
		this.length = length;
		this.current = ((current >= 1) ? current : 1);
		this.begin = ((current - 1) * length);
		this.end = current * length;
	}

	public int getBegin() {
		return begin;
	}

	public void setBegin(int begin) {
		this.begin = begin;
	}

	public int getEnd() {
		return end;
	}

	public void setEnd(int end) {
		this.end = end;
	}

	public int getLength() {
		return length;
	}

	public void setLength(int length) {
		this.length = length;
	}

	public int getCurrent() {
		return current;
	}

	public void setCurrent(int current) {
		this.current = current;
	}
}
